<?php

use Illuminate\Database\Seeder;
class UserTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //声明空数组 存放所有数据
        $data = [];
        $udata = [];
        //循环写数据
        for($i=0;$i<=50;$i++){
        	//声明空数组记录每一条数据
        	$tmp = [];
            $utmp = [];
        	$tmp['name'] = str_random(10);
        	$tmp['email'] = str_random(6).'@163.com';
        	$tmp['password'] = Hash::make('secret');
            $utmp['nickName']=$tmp['name'];
        	$data[] = $tmp;
            $udata[] = $utmp;
        }

        DB::table('users')->insert($data);
        DB::table('userdetail')->insert($udata);
    }
}
